const router = require("koa-router")();
const UserModel = require("../../models/users");
router.post("/api/user", async ctx => {
    var { loginAuth, id } = ctx.request.body;
    if(loginAuth){
        var data = await UserModel.find({_id:id});
        ctx.body = {
            code: 200,
            res: data,
            msg: `请求成功!`
        }
    }else{
        ctx.body = {
            code: 400,
            msg: "请登录！"
        }
    }

})
module.exports = router;